package com.caishi.lkx.exam.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zzw.common.entity.IBaseMapper;
import com.caishi.lkx.user.model.MaterialInfoModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author by liyihua
 * @date : 2022-01-06 14:29
 */
public interface MaterialInfoMapper extends IBaseMapper<MaterialInfoModel, String> {

    @Select("select sys_material_info.* from sys_material_info left join sys_material_like on sys_material_info.id=sys_material_like.relation_id where sys_material_like.type=0 and sys_material_like.deleted = 0 and sys_material_like.created_by=#{userId} and sys_material_info.deleted = 0 order by sys_material_like.created_time DESC")
    IPage<MaterialInfoModel> getMyLike(IPage page,@Param("userId") String userId);

    IPage<MaterialInfoModel> materialInfoByColumnIdPage(Page<MaterialInfoModel> page, @Param("param") Map<String,Object> param);
}
